﻿using System;
using System.Collections.Generic;
using System.Text;

namespace OrderExer
{
    //订单明细
    public class OrderDetails
    {
        //Customer customer;//客户对象
        //Commodity commodity;//商品对象
        string age;
        string date;
        string cusname;
        string comname;
        
        public OrderDetails() { }
        public OrderDetails(string cusname,string age,string comname,string date)
        {
            //Customer = new Customer(cusname, age);
            //Commodity = new Commodity(comname, date);
            this.Age = age;
            this.Date = date;
            this.Cusname = cusname;
            this.Comname = comname;
        }

        public string Age { get => age; set => age = value; }
        public string Date { get => date; set => date = value; }
        public string Cusname { get => cusname; set => cusname = value; }
        public string Comname { get => comname; set => comname = value; }

        public override bool Equals(object obj)
        {
            return base.Equals(obj);
        }

        public override int GetHashCode()
        {
            return base.GetHashCode();
        }

        //internal Customer Customer { get => customer; set => customer = value; }
        //internal Commodity Commodity { get => commodity; set => commodity = value; }


        public override string ToString()
        {
            string s;
            if(Age==null || Date == null)
            {
                s = "";
            }
            else s = " 客户信息：" + "年龄:" + this.Age + ",商品信息：" + "商品生产日期:" + this.Date;
            return s ;
        }
    }
}
